<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>CSI udp to server: /home/shuspieler/Atheros-CSI-Tool-UserSpace-APP/recvCSI-with-socket/udp.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">CSI udp to server
   &#160;<span id="projectnumber">v1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.8 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">/home/shuspieler/Atheros-CSI-Tool-UserSpace-APP/recvCSI-with-socket/udp.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>init and close function for socket(udp)  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdio.h&gt;</code><br />
<code>#include &lt;stdlib.h&gt;</code><br />
<code>#include &lt;string.h&gt;</code><br />
<code>#include &lt;sys/types.h&gt;</code><br />
<code>#include &lt;sys/socket.h&gt;</code><br />
<code>#include &lt;linux/in.h&gt;</code><br />
</div><div class="textblock"><div class="dynheader">
Include dependency graph for udp.c:</div>
<div class="dyncontent">
<div class="center"><img src="udp_8c__incl.png" border="0" usemap="#_2home_2shuspieler_2Atheros-CSI-Tool-UserSpace-APP_2recvCSI-with-socket_2udp_8c" alt=""/></div>
</div>
</div><div class="textblock"><div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="udp_8c__dep__incl.png" border="0" usemap="#_2home_2shuspieler_2Atheros-CSI-Tool-UserSpace-APP_2recvCSI-with-socket_2udp_8cdep" alt=""/></div>
<map name="_2home_2shuspieler_2Atheros-CSI-Tool-UserSpace-APP_2recvCSI-with-socket_2udp_8cdep" id="_2home_2shuspieler_2Atheros-CSI-Tool-UserSpace-APP_2recvCSI-with-socket_2udp_8cdep">
<area shape="rect" id="node2" href="main_8c.html" title="main function: log CSI to file or to server or to both. " alt="" coords="5,109,193,165"/></map>
</div>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aff119789f658dc4654c7d31d04caa9ea"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="udp_8c.html#aff119789f658dc4654c7d31d04caa9ea">init_udp</a> (const char *strptr, unsigned short portnum)</td></tr>
<tr class="separator:aff119789f658dc4654c7d31d04caa9ea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7e1d80b405a569a1d308aa0b9244514d"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="udp_8c.html#a7e1d80b405a569a1d308aa0b9244514d">close_udp</a> (int cfd)</td></tr>
<tr class="separator:a7e1d80b405a569a1d308aa0b9244514d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>init and close function for socket(udp) </p>
<p>=====================================================================================</p>
<dl class="section version"><dt>Version</dt><dd>1.0</dd></dl>
<dl class="section author"><dt>Author</dt><dd>Shu</dd></dl>
<p>Email : <a href="#" onclick="location.href='mai'+'lto:'+'ier'+'en'+'shu'+'@1'+'63.'+'co'+'m'; return false;">ieren<span style="display: none;">.nosp@m.</span>shu@<span style="display: none;">.nosp@m.</span>163.c<span style="display: none;">.nosp@m.</span>om</a></p>
<dl class="section date"><dt>Date</dt><dd>Juni,2017</dd></dl>
<p>Organization: LIKE @ FAU</p>
<p>Copyright (c) LIKE @ FAU </p><hr/>
</div><h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a7e1d80b405a569a1d308aa0b9244514d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int close_udp </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>cfd</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>close socket after use</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cfd</td><td>handle of socket </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="aff119789f658dc4654c7d31d04caa9ea"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int init_udp </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>strptr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned short&#160;</td>
          <td class="paramname"><em>portnum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>this function will initialize the socket which use udp protocal</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">strptr</td><td>parameter for ip address of the server, which should be a 15 bit char array or simplely like this: const char strptr[] = "192.168.199.120" </td></tr>
    <tr><td class="paramname">portnum</td><td>port number of the server eg: unsigned short portnum = 0x1031 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>if the socket_init is ok, it will the return the handle of the socket if something wrong, it will return -1 and print a message </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jun 28 2017 07:03:56 for CSI udp to server by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>
